label define targlab 1 "Business" 2 "Government (General)" 3 "Police" 4 "Military" 5 "Abortion Related" 6 "Airports" 7 "Government (Non-Diplomatic)" 8 "Education" 9 "Food or Water" 10 "Journalists" 11 "Maritime" 12 "NGO" 13 "Other" 14 "Private Citizens" 15 "Religious" 16 "Telecommunications" 17 "Terrorists" 18 "Tourists" 19 "Transportation" 20 "Unknown" 21 "Utilities" 22 "Violent Pol. Parties" 
label define attacklab 1 "Facility/Infrastructure Attack" 2 "Unarmed Assault" 3 "Armed Assault" 4 "Bombing/Explosion" 5 "Barricade Incident" 6 "Kidnapping" 7 "Hijacking" 8 "Assassination"
label values attacktypenew2 attacklab
label values targtype1 targlab
set more off

* Table 1 *
xtlogit doubtterr3 targetgp attacktypenew2 lognkill mediascore logttime_min logigcp_mer logmountains_mean logipopden logbdist1 civconf attacksum post911yn if specificity<4, re i(ccode)
margins, predict(pu0) atmeans
margins, predict(pu0) at (targetgp=(0 1)) atmeans
margins, predict(pu0) at (lognkill=(-4.60517 2.302585)) atmeans
margins, predict(pu0) at (mediascore=(1(1)3)) atmeans
margins, predict(pu0) at (logttime_min=(-4.60517 5.129899)) atmeans
margins, predict(pu0) at (logipopden=(2.800238 8.057701)) atmeans
margins, predict(pu0) at (logbdist1=(2.278371 6.25538)) atmeans
margins, predict(pu0) at (civconf=(0 1)) atmeans
margins, predict(pu0) at (attacksum=(13 2849)) atmeans
margins, predict(pu0) at (post911yn=(0 1)) atmeans
outreg2 using DataPaperResults121117.doc, e(N ll chi2) bdec(3)word alpha(.01, .05, .1) eqdrop(lnsig2u) 

* Table 1 margins for attack type
xtlogit doubtterr3 targetgp i.b1.attacktypenew2 lognkill mediascore logttime_min logigcp_mer logmountains_mean logipopden logbdist1 civconf attacksum post911yn if specificity<4, re i(ccode)
margins, predict(pu0) at (attacktypenew2=(1/8)) atmeans 
marginsplot, recast(scatter)

* Figure 1
xtlogit doubtterr3 targetgp i.b1.attacktypenew2 lognkill mediascore logttime_min logigcp_mer logmountains_mean logipopden logbdist1 civconf attacksum post911yn if specificity<4, re i(ccode)
margins r.b1.attacktypenew2, predict(pu0) atmeans
marginsplot, recast(scatter) yline(0) xlabel (`= 2 vs 1' "Unarmed Assault" `= 3 vs 1' "Armed Assault" `= 4 vs 1' "Bombing/Explosion" `= 5 vs 1' "Barricade Incident" `= 6 vs 1' "Kidnapping" `= 7 vs 1' "Hijacking" `= 8 vs 1' "Assassination")

* Figure 2
xtlogit doubtterr3 c.(targetgp attacktypenew2 lognkill logttime_min logigcp_mer logmountains_mean logipopden logbdist1 attacksum civconf attacksum post911yn)#i.mediascore if specificity<4, re i(ccode)
margins, predict(pu0) atmeans
margins mediascore, at (lognkill=(-4 (2) 7)) predict(pu0) 
marginsplot

** APPENDICES **

* Appendix Table A1 - Polo & Gleditsch targets
tab targtype1 targetgp 

* Appendix Table A2 - new PG target types
gen targetgp2 = targetgp
replace targetgp2 = 0 if targtype1 == 5
replace targetgp2 = 0 if targtype1 == 17
replace targetgp2 = 0 if targtype1 == 22

xtlogit doubtterr3 targetgp2 attacktypenew2 lognkill mediascore logttime_min logigcp_mer logmountains_mean logipopden logbdist1 civconf attacksum post911yn if specificity<4, re i(ccode)
margins, predict(pu0) atmeans
margins, predict(pu0) at (targetgp=(0 1)) atmeans
outreg2 using A2.doc, e(N ll chi2) bdec(3)word alpha(.01, .05, .1) eqdrop(lnsig2u) replace 

* Appendix Table A3 & A4 - marginal effects
xtlogit doubtterr3 targetgp attacktypenew2 lognkill mediascore logttime_min logigcp_mer logmountains_mean logipopden logbdist1 civconf attacksum post911yn if specificity<4, re i(ccode)
margins, predict(pu0) atmeans
margins, predict(pu0) at (targetgp=(0 1)) atmeans
margins, predict(pu0) at (lognkill=(-4.60517 2.302585)) atmeans
margins, predict(pu0) at (mediascore=(1(1)3)) atmeans
margins, predict(pu0) at (logttime_min=(-4.60517 5.129899)) atmeans
margins, predict(pu0) at (logipopden=(2.800238 8.057701)) atmeans
margins, predict(pu0) at (logbdist1=(2.278371 6.25538)) atmeans
margins, predict(pu0) at (civconf=(0 1)) atmeans
margins, predict(pu0) at (attacksum=(13 2849)) atmeans
margins, predict(pu0) at (post911yn=(0 1)) atmeans

* Appendix Table A5 - attack type dummies
xtlogit doubtterr3 targetgp i.b1.attacktypenew2 lognkill mediascore logttime_min logigcp_mer logmountains_mean logipopden logbdist1 civconf attacksum post911yn if specificity<4, re i(ccode)
outreg2 using A5.doc, e(N ll chi2) bdec(3)word alpha(.01, .05, .1) eqdrop(lnsig2u) replace

* Appendix Table A6 - wealth squared
xtlogit doubtterr3 targetgp attacktypenew2 lognkill mediascore logttime_min c.logigcp_mer##c.logigcp_mer logmountains_mean logipopden logbdist1 civconf attacksum post911yn if specificity<4, re i(ccode)
outreg2 using A6.doc, e(N ll chi2) bdec(3)word alpha(.01, .05, .1) eqdrop(lnsig2u) replace

* Appendix Table A7 - w/o civwar
xtlogit doubtterr3 targetgp attacktypenew2 lognkill mediascore logttime_min logigcp_mer logmountains_mean logipopden logbdist1 attacksum post911yn if specificity<4, re i(ccode)
outreg2 using A7.doc, e(N ll chi2) bdec(3)word alpha(.01, .05, .1) eqdrop(lnsig2u) replace




